import Vue from 'vue'
import Router from 'vue-router'
import _ from 'lodash'
// import layout from '@/views/home/layout/index'

Router.prototype.openPage = function (link, query) {
  this.push({
    path: link,
    query: _.assignIn({
      time: new Date().getTime()
    }, query || {})
  })
};

Vue.use(Router);


export default new Router({
  //打包时注释掉
  // mode: 'history',
  // base: process.env.BASE_URL,
  routes: [
    //导航重定向
    {
      path: '/',
      redirect: '/main'
    },
    // 概况
    {
      path: '/main',
          name: 'main',
          component(resolve) {
            require(['@/views/main/main.vue'], resolve)
          },
          meta: {
            title: '概况', icon: '', noCache: true
          }
    },
	{
	  path: '/mLeaflet',
	      name: 'mLeaflet',
	      component(resolve) {
	        require(['@/views/main/mLeaflet.vue'], resolve)
	      },
	      meta: {
	        title: '概况', icon: '', noCache: true
	      }
	},
  ]
})
